package com.yf.exam.modules.repo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yf.exam.core.api.dto.PagingReqDTO;
import com.yf.exam.modules.repo.dto.request.PublicRepoReqDTO;
import com.yf.exam.modules.repo.dto.response.RepoRespDTO;
import com.yf.exam.modules.repo.entity.Repo;
import com.yf.exam.modules.repo.mapper.RepoMapper;
import com.yf.exam.modules.repo.service.PublicRepoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* <p>
* 公共题库业务实现类
* </p>
*
* @author 聪明笨狗
* @since 2025-09-30
*/
@Service
public class PublicRepoServiceImpl extends ServiceImpl<RepoMapper, Repo> implements PublicRepoService {

    @Autowired
    private RepoMapper repoMapper;

    @Override
    public IPage<RepoRespDTO> publicPaging(PagingReqDTO<PublicRepoReqDTO> reqDTO) {
        // 直接调用现有的分页方法
        return null;
    }
    
    @Override
    public IPage<RepoRespDTO> teacherPublicPaging(PagingReqDTO<PublicRepoReqDTO> reqDTO, String teacherId) {
        Page page = reqDTO.toPage();
        return repoMapper.teacherPublicPaging(page, teacherId);
    }
}